@(zw:String)
<!DOCTYPE html>

<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>招聘</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
        <script src="@routes.Assets.at("js/jquery/jquery-1.9.0.min.js")"></script>
        <script src="@routes.Assets.at("plugins/qiniu/plupload/plupload.full.min.js")" type="text/javascript"></script>
        <script src="@routes.Assets.at("plugins/qiniu/qiniu.js")" type="text/javascript"></script>
        <style type="text/css">
        #nameDiv,#telDiv{
        height: 10%;
        }
        body{
        background-color:rgb(222, 222, 222)
        }

        body >div>div{
        height: 100%;
            margin-top: 20px;
        }

        body span{
        display:inline-block;
        width:15%;
        height : 30px ;
        line-height: 30px;
        }

        body input{
        width:75%;
        height: 30px;
        padding-left: 10px;
        }

        body a{
        color: #fff;
        height: 30px;
        display: block;
        text-align: center;
        border: solid 1px #bfbfbf;
        font-size: 16px;
        line-height: 30px;
        }
        </style>


    </head>
    <body style="margin: 0 auto;background:#FFF url('@routes.Assets.at("zbtz/images/body_bg.jpg")') top center;">
        <div style="height : 100%; width: 90%;margin-left: 5%">
            <div style="height: 10%;font-size: 30px;">职位：@if(zw.equals("sxs")){实习生}else{信息技术}</div>
            <div id="nameDiv">
                <span style="">姓名</span>
                <input type="text" name="name">
            </div>
            <div id="telDiv">
                <span style="" >电话</span>
                <input type="text"name="tel" maxlength="11" onkeyup="this.value = this.value.replace ( /\D/g, '' )" onafterpaste="this.value=this.value.replace(/\D/g,'')">
            </div>

            <div style="height:10%" class="upload" id="uploadResumeApplyParent">
                <a id="uploadResumeApply" style="width:100px ; float:left ; margin-right:10px;background-color: #0C5FBC;border-radius: 5px">上传简历</a>
                <span style="line-height : 30px;overflow: hidden;text-overflow: ellipsis;display: inline-block;width: 50%" id="uploadResumeApplyFileName"></span>
                <span style="line-height :301px;overflow: hidden;text-overflow: ellipsis;display:none" id="uploadResumeApplyFileUrl" ></span>
            </div>
            <div style="height:10%">
                <a onclick="submit()" style="width :100%;background-color: #20A0BE;color: white;border-radius: 5px; height: 35px;line-height:35px  ">提交</a>
            </div>
        </div>

        <div id="loading" style=" position: fixed;   top: 0%;    left: 0;   width: 100%;  height: 100%;  z-index: 10000" hidden="hidden">
            <div style="width: 100%;height: 100%;position: relative">
                <div style="position: absolute;left: 50%;top:50%;margin-left: -8px;margin-top: -9px">
                    <img src="@routes.Assets.at("images/loading2.gif")">
                </div>
            </div>
        </div>
    </body>
    <script>

      var uploader = Qiniu.uploader({
            runtimes: 'html5,flash,html4',    //上传模式,依次退化
            browse_button: 'uploadResumeApply',       //上传选择的点选按钮，**必需**
            uptoken_url: '/qiniu/js/token/zbtz',
            unique_names: true,
            domain: '7xsqo0.com1.z0.glb.clouddn.com',
            container: 'uploadResumeApplyParent',           //上传区域DOM ID，默认是browser_button的父元素，
            max_file_size: '100mb',           //最大文件体积限制
            flash_swf_url: '/assets/plugins/qiniu/plupload/Moxie.swf',  //引入flash,相对路径
            max_retries: 3,                   //上传失败最大重试次数
            dragdrop: true,                   //开启可拖曳上传
            drop_element: 'uploadResumeApplyParent',        //拖曳上传区域元素的ID，拖曳文件或文件夹后可触发上传
            chunk_size: '4mb',                //分块上传时，每片的体积
            auto_start: true,                 //选择文件后自动上传，若关闭需要自己绑定事件触发上传
            filters : {
            max_file_size : '100mb',
            prevent_duplicates: true,
            // Specify what files to browse for
                mime_types: [
                    {title : "Image files", extensions : "jpg,png"}, // 限定jpg,gif,png后缀上传
                    {title : "other files", extensions : "pdf"}, // 限定jpg,gif,png后缀上传
                ]
            },
            init: {
                'FilesAdded': function(up, files) {
                    plupload.each(files, function(file) {
                        // 文件添加进队列后,处理相关的事情

                    });
                },
                'BeforeUpload': function(up, file) {
                    loadingStart()
                    // 每个文件上传前,处理相关的事情
                },
                'UploadProgress': function(up, file) {
                    // 每个文件上传时,处理相关的事情
                },
                'FileUploaded': function(up, file, info) {
                    var temp = JSON.parse(info);
                    $("#uploadResumeApplyFileName").text(file.name)
                    loadingEnd()
                    $("#uploadResumeApplyFileUrl").text("http://7xsqo0.com1.z0.glb.clouddn.com/"+temp.key)
                },
                'Error': function(up, err, errTip) {
//                    console.log(err)
                    if(err.code==-601){
                        alert("请上传jpg,png格式图片或者pdf")
                    }
                       loadingEnd()

                },
                'UploadComplete': function() {
                    //队列文件处理完毕后,处理相关的事情
                       loadingEnd()
                },
                'Key': function(up, file) {
                    var key = "";
                    return key
                }
            }
        });

         function submit(){
        var name = $("input[name='name']").val();
        var tel = $("input[name='tel']").val();
        var fileName = $("#uploadResumeApplyFileName").text();
        var fileUrl = $("#uploadResumeApplyFileUrl").text();
        if(name==""){
            alert("请输入姓名")
            return false
        }
        if(tel==""){
            alert("请输入电话")
            return false
        }
         if(fileName==""||fileUrl==""){
            alert("请上传简历")
            return false
        }


        $.post('/temp/zbtz/signup2',
            {
                name:name,
                tel:tel,
                tag:'@zw',
                fileName:fileName,
                fileUrl:fileUrl
            },function(data){
                if(data.success){
                    alert("报名成功")
                }else{
                    alert("报名失败")
                }
            },'json')
    }

    function loadingStart(){
    $("#loading").show()
    $("#loadingCover").show()

}

function loadingEnd(){
    $("#loading").hide()
    $("#loadingCover").hide()
}
    </script>
</html>



